Skip to content

Conversation

nate-chandler
Copy link
Contributor

Previously, CanonicalizeInstruction::eliminateSimpleBorrows bailed out when encountering any any [lexical] begin_borrow. While generally such borrow scopes must be preserved, they may be removed if they are redundant (when the borrowed value is guaranteed by another means: an outer lexical borrow scope or a guaranteed function argument). Here, removing such redundant lexical borrow scopes is enabled.Previously, CanonicalizeInstruction::eliminateSimpleBorrows bailed out when encountering any any [lexical] begin_borrow. While generally such borrow scopes must be preserved, they may be removed if they are redundant (when the borrowed value is guaranteed by another means: an outer lexical borrow scope or a guaranteed function argument). Here, removing such redundant lexical borrow scopes is enabled.

@nate-chandler nate-chandler requested a review from atrick December 8, 2021 01:08
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

Promoted isRedundantLexicalBeginBorrow function to OwnershipUtils so
that it can be used in more than just SemanticARCOpts.
@nate-chandler nate-chandler force-pushed the lexical_lifetimes/remove-simple-lexical-borrow-if-redundant branch from 52ad611 to 718d5f9 Compare December 8, 2021 01:51
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

Previously, CanonicalizeInstruction::eliminateSimpleBorrows bailed out
when encountering any any [lexical] begin_borrow.  While generally such
borrow scopes must be preserved, they may be removed if they are
redundant (when the borrowed value is guaranteed by another means: an
outer lexical borrow scope or a guaranteed function argument).  Here,
removing such redundant lexical borrow scopes is enabled.
@nate-chandler nate-chandler force-pushed the lexical_lifetimes/remove-simple-lexical-borrow-if-redundant branch from 718d5f9 to ac50bb7 Compare December 8, 2021 02:41
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 8, 2021

Build failed
Swift Test Linux Platform
Git Sha - ac50bb7

@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test linux platform

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@nate-chandler nate-chandler merged commit f95748c into swiftlang:main Dec 8, 2021
@nate-chandler nate-chandler deleted the lexical_lifetimes/remove-simple-lexical-borrow-if-redundant branch December 8, 2021 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants